// room script file

function room_LeaveTop()
{
	if(player.HasInventory(iNunchuks))
	{
		player.ChangeRoom(room_BattleKotsopolous.RoomNum);
	}
	else
	{
		player.Think("I should at least complete 1 item on my Todo list before I leave.");
		player.Walk(44, Room.TopEdge+1, eBlock);
	}
}

function room_FirstLoad()
{
	player.LockView(VWRHSLEEP);
	player.Animate(0, 1, eOnce, eBlock, eForwards);
	
	//PlaySound(2);
	player.Think("Fuck, how I miss my ROCKET HORSE!");
	player.Think("I shouldn't have drank so much last night...");
	player.Think("What the fuck is that ringing?");
	player.UnlockView();
	
	player.ChangeView(VRH);
	player.x = 254;
	player.y = 191;
}

function hPhone_Look()
{
	player.Think("That's a mighty fine phone.");
}

function hPhone_Interact()
{
	if(GuardAuthor.available && !GuardAuthor.received)
		dCJFirstCall.Start();
	else if(GuardAuthor.received && !GuardAuthor.complete)
		dRHCallCJFirstJob.Start();
	else if(ConfrontJohnRenegade.available && !ConfrontJohnRenegade.received)
		dCJSecondCall.Start();
	else if(ConfrontJohnRenegade.received && !ConfrontJohnRenegade.complete)
		dCJSecondCall2.Start();
	else
		Display("The phone wasn't even ringing. You may be crazy.");
}

function hWasteBin_Look()
{
	player.Move(120, 186, eBlock, eWalkableAreas);
	player.ChangeRoom(6);
}

function oBrokenMop_Interact()
{
	oObject_Interact(oBrokenMop, iBrokenMop, "I found the broken mop!!!!");
}

/*
function oNunchuks_Interact()
{
	player.Move(86, 176, eBlock, eWalkableAreas);
	player.AddInventory(iNunchuks);

	oNunchuks.Visible = false;
	player.Say("These could really hurt someone! I better bring them with me.");
}
*/

function oBikeChain_Interact()
{
	player.Move(oBikeChain.X, oBikeChain.Y, eBlock, eWalkableAreas);
	player.AddInventory(iBikeChain);

	oBikeChain.Visible = false;
	player.Think("A bike chain. Strange, I've never owned a bike...");
}

function oBrokenMop_Look()
{
	Display("Broken Mop");
}

function oBikeChain_Look()
{
	Display("Bike Chain");
}


function oHat_Interact()
{
	oObject_Interact(oHat, iHat, "Fancy Hat!", 73, 176);
}

function room_Load()
{
	if (GuardAuthor.complete && ConfrontJohnRenegade.available && !ConfrontJohnRenegade.received)
	{
	  player.Think("Man, where the hell is my Rocket Horse? Hm. Oh crap, there goes the phone again. What is it this time?");
	}
}

function oTodoList_Look()
{
	player.Walk(170, 185, eBlock);
	player.Think("To Do:");
	player.Think("Buy bread");
	player.Think("Look for Rocket Horse");
	String todoNunchucks = "Combine broken broom with spare bike chain (recycling saves the Earth!)";
	if(player.HasInventory(iNunchuks))
		todoNunchucks = todoNunchucks.Append(" CHECK");
	player.Think(todoNunchucks);
}
